package com.neuedu.common.domain.converter.annotation;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

/**
 * 想使用此注解需要在使用的converter中引入
 * {@link com.neuedu.common.utils.SecurityUtils}
 * {@link cn.hutool.core.date.DateUtil}
 *
 * @author Punkhoo
 */
@Retention(RetentionPolicy.CLASS)
@Mappings(value = {
    @Mapping(target = "updateBy", expression = "java(SecurityUtils.getUsername())"),
    @Mapping(target = "updateTime", expression = "java(DateUtil.date())"),
    @Mapping(target = "params", ignore = true),
    @Mapping(target = "searchValue", ignore = true)
})
public @interface UpdateCommon {
}
